<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var fs = require('fs');
        fs.readFile('./test.txt', 'utf-8', function (err, data) {
            // 读取文件失败/错误
            if (err) {
                console.log(err)
                throw err;
            }
            // 读取文件成功
            console.log('utf-8: ', data.toString());
        });

    </script>
</head>

<body>


</body>

</html>